#ifndef COM_H
#define COM_H

#include "qextserialbase.h"
#include "qextserialport.h"
#include "win_qextserialport.h"
#include <QString>
#include <QObject>
#include<QMessageBox>
#include "systemsettingdialog.h"
class COM :public QObject
{
    Q_OBJECT
public:
    COM();
    ~COM();
    Win_QextSerialPort *getMyCom();
    void closeCom();

     void initCom(QString portName);
     void initCom(QString portName,QString BaudRate,QString DataBits,QString StopBits,QString Parity,QString FlowControl);
     void setSystemSettingDialogDialog(SystemSettingDialog *paramSSD);
     SystemSettingDialog* getSystemSettingDialog();

private slots:
      QByteArray readMyCom();
      void changePort();
private:
    Win_QextSerialPort *myCom;
    SystemSettingDialog *systemSettingDialog;
    QString port;
    QString BaudRate;
    QString DataBits;
    QString StopBits;
    QString Parity;
    QString FlowControl;
    bool writeLock;
};

#endif // COM_H
